package online.cmagic.structureType.bridge;

/**
 * @author wsc
 * @date: 2020年04月14日 15:55
 * @since JDK 1.8
 */
public abstract class Computer {

    protected Brand brand;

    public Computer(Brand brand) {
        this.brand = brand;
    }

    public abstract void sale();

}
class Desktop extends Computer{

    public Desktop(Brand brand) {
        super(brand);
    }

    public void sale() {
        brand.sale();
        System.out.println("销售台式电脑");
    }
}
class Laptop extends Computer{

    public Laptop(Brand brand) {
        super(brand);
    }

    public void sale() {
        brand.sale();
        System.out.println("销售笔记本电脑");
    }
}
class Pad extends Computer{

    public Pad(Brand brand) {
        super(brand);
    }

    public void sale() {
        brand.sale();
        System.out.println("销售平板电脑");
    }
}